<?php

class Eleven_Form_Teacher_Content extends Zend_Form
{
	public function init()
	{
	    $this->setDisableLoadDefaultDecorators(true);
        $this->setDecorators(array(
            array(
                'ViewScript',
                array('viewScript'=>'teacher/_publish.phtml')
            ),
            'Form'
        ));
        
	    $this->addElementPrefixPath(
            'Eleven_Validate',
            APPLICATION_PATH . '/models/validate/',
            'validate'
        );
	    
		$this->addElement('text', 'title', array(
			'required'		=> true,
			'label'			=> '活动标题：',
		));
		$this->getElement('title')->setDecorators(array(
            'ViewHelper',
		    'Errors',
        ));
		
		$this->addElement('select','type', array(
		    'label'		=> '内容分类：',
		    'validators' => array(array('TopicValidate')),
        ));
        		
        $topicMultiOptions = array();
        $topicMultiOptions[0] = '';
        $topicMultiOptions['s'] = '关注学校';
        $topicMultiOptions['n'] = '关注国家';
        $topicMultiOptions['f'] = '关注世界';
                
        $this->getElement('type')->setMultiOptions($topicMultiOptions);
		$this->getElement('type')->setValue('0');
		$this->getElement('type')->setDecorators(array(
            'ViewHelper',
		    'Errors',
        ));
		
		$this->addElement('textarea', 'content', array(
			'required'		=> true,
			'label'			=> '活动内容：',
		));
		$this->getElement('content')->setDecorators(array(
            'ViewHelper',
		    'Errors',
        ));
		
		$this->addElement('hidden', 'id');
		
		$this->addElement('submit', 'submit', array(
			'required'		=> true,
			'ignore'		=> true,
		));
	}

}

?>